﻿<?php
class Model_Paymentstatus extends Zend_Db_Table_Abstract
{
	protected $_name = 'payment_status';
	protected $_primary = 'ps_id';

	public function createPaymentstatus ($ps_id,$ps_ten)
	{
		$rowPaymentstatus= $this->createRow();
		if ($rowPaymentstatus) {
			// update the row values
			$rowPaymentstatus->ps_id = $ps_id;
			$rowPaymentstatus->ps_ten = $ps_ten;
			$rowPaymentstatus->save();			
			//return the new paymentstatus.		
			return $rowPaymentstatus;
		} else {
			throw new Zend_Exception("Không thể tạo paymentstatus này!!!");
		}
	}
		
	public static function getPaymentstatusById($ps_id)
	{
		$row = $this->find($ps_id)->current();	
		return $row;
	}	
	
	public static function getPSByID($ps_id)
	{
		$paymentstatusModel = new self();
		$select = $paymentstatusModel->select();
		$select->order(array('ps_id'))
				->where('ps_id=?',$ps_id);	
		return $paymentstatusModel->fetchAll($select);
	}
		
	
	public static function getPaymentstatusAll()
	{
		$paymentstatusModel = new self();
		$select = $paymentstatusModel->select();
		$select->order(array('ps_id'));	
		return $paymentstatusModel->fetchAll($select);
	}	

	
}